<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:86:"D:\phpStudy\PHPTutorial\WWW\xbs22\fly\public/../application/admin\view\ques\index.html";i:1542350444;s:72:"D:\phpStudy\PHPTutorial\WWW\xbs22\fly\application\admin\view\layout.html";i:1542336746;}*/ ?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台登录-X-admin2.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" href="/static/admin/css/font.css">
	<link rel="stylesheet" href="/static/admin/css/xadmin.css">
	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
</head>
<body>
<div class="x-nav">
	<span class="layui-breadcrumb">
		<a href="">首页</a>
		<a href="">演示</a>
		<a>
			<cite>导航元素</cite></a>
	</span>
	<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
		<i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
	<div class="layui-row">
		<form class="layui-form layui-col-md12 x-so">
		<div class="layui-input-inline">
		<select name="status">
		<option>帖子状态</option>
		<option value="1">已结</option>
		<option value="2">未结</option>
		</select>
		</div>
		<div class="layui-input-inline">
		<select name="is_top">
		<option>是否置顶</option>
		<option value="1">已置顶</option>
		<option value="2">未置顶</option>
		</select>
		</div>
		<div class="layui-input-inline">
		<select name="is_good">
		<option>是否精贴</option>
		<option value="1">精贴</option>
		<option value="2">否精贴</option>
		</select>
		</div>
		<button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
		</form>
	</div>
	<xblock>
		<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>
		<span class="x-right" style="line-height:40px">共有数据：<?php echo $we->total(); ?> 条</span>
	</xblock>
	<table class="layui-table" style="">
		<thead>
		<tr>
			<th>
				<div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
			</th>
			<th>ID<a href="<?php echo url('admin/Ques/index',['ID'=>'desc']); ?>"><i class="layui-icon" style="font-size: 5px;" >&#xe619;</i></a><a href="<?php echo url('admin/Ques/index',['ID'=>'ase']); ?>"><i class="layui-icon" style="font-size: 10px;" >&#xe61a;</i></a></th>
			<th>标题</th>
			<th>所属用户</th>
			<th>浏览量 <a href="<?php echo url('admin/Ques/index',['view_num'=>'desc']); ?>"><i class="layui-icon" style="font-size: 5px;" >&#xe619;</i></a><a href="<?php echo url('admin/Ques/index',['view_num'=>'ase']); ?>"><i class="layui-icon" style="font-size: 5px;">&#xe61a;</i></a></th>
			<th>回复量 <a href="<?php echo url('admin/Ques/index',['reply_num'=>'desc']); ?>"><i class="layui-icon" style="font-size: 5px;" >&#xe619;</i></a><a href="<?php echo url('admin/Ques/index',['reply_num'=>'ase']); ?>"><i class="layui-icon" style="font-size: 5px;">&#xe61a;</i></a></th>
			<th>飞吻<a href="<?php echo url('admin/Ques/index',['kiss'=>'desc']); ?>"><i class="layui-icon" style="font-size: 5px;" >&#xe619;</i></a><a href="<?php echo url('admin/Ques/index',['kiss'=>'ase']); ?>"><i class="layui-icon" style="font-size: 5px;" >&#xe61a;</i></a></th>
			<th>所属分类</th>
			<th>状态</th>
			<th>置顶</th>
			<th>精贴</th>
			<th>发布时间</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		<?php if(is_array($ques) || $ques instanceof \think\Collection || $ques instanceof \think\Paginator): $i = 0; $__LIST__ = $ques;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$row): $mod = ($i % 2 );++$i;?>
		<tr>
			<td>
				<div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='<?php echo $row['question_id']; ?>'><i class="layui-icon">&#xe605;</i></div>
			</td>
			<td><?php echo $row['question_id']; ?></td>
			<td style="max-width:200px ;height: 20px;overflow: hidden;white-space: nowrap; text-overflow: ellipsis;"><a
					href="<?php echo url('index/nom/index',['qid'=>$row['question_id']]); ?>"><?php echo $row['title']; ?></a></td>
			<td><?php echo $row['nickname']; ?></td>
			<td><?php echo $row['view_num']; ?></td>
			<td><?php echo $row['reply_num']; ?></td>
			<td><?php echo $row['kiss']; ?></td>
			<td><?php echo $row['cate_name']; ?></td>
			<td>
				<?php if($row['status']==1): ?>
				<span class="layui-btn  layui-btn-sm  layui-btn-mini">已结</span>
				<?php else: ?>
				<span class="layui-btn layui-btn-sm  layui-btn-mini layui-btn-disabled">未结</span>
				<?php endif; ?>
			</td>
			<td>
				<?php if($row['is_top']==1): ?>
				<span class="layui-btn  layui-btn-sm  layui-btn-normal layui-btn-mini">已置顶</span>
				<?php else: ?>
				<span class="layui-btn layui-btn-sm   layui-btn-normal layui-btn-mini layui-btn-disabled">未置顶</span>
				<?php endif; ?>
			</td>
			<td>
				<?php if($row['is_good']==1): ?>
				<span class="layui-btn  layui-btn-warm  layui-btn-sm layui-btn-mini">为精贴</span>
				<?php else: ?>
				<span class="layui-btn layui-btn-sm  layui-btn-warm  layui-btn-mini layui-btn-disabled">否精贴</span>
				<?php endif; ?>
			</td>
			<td><?php echo $row['create_time']; ?></td>
			<td class="td-manage">
				<a title="删除" onclick="member_del(this,<?php echo $row['question_id']; ?>)" href="javascript:;">
					<i class="layui-icon">&#xe640;</i>
				</a>
			</td>
		</tr>
		<?php endforeach; endif; else: echo "" ;endif; ?>
		</tbody>
	</table>
	<div class="page">
		<?php echo $we->render(); ?>
	</div>
</div>
<script>
	/*用户-删除*/
	function member_del(obj, id) {
		layer.confirm('确认要删除吗？', function (index) {
			//发异步删除数据
			$.post("<?php echo url('admin/Ques/del'); ?>", {question_id: id}, function(res, textStatus, xhr) {
                if (res.code == 0) {
                    layer.msg(res.msg, function () {
                    });
                } else {
                    layer.alert(res.msg, function () {
                        location.reload();
                    })
                }
			});
		});
	}

	function delAll(argument) {
		var data = tableCheck.getData();
		qid = '';
		for (var i in data){
		    qid +=data[i]+","
		}
		layer.confirm('确认要删除吗？' , function (index) {
			//捉到所有被选中的，发异步进行删除
			$.post("<?php echo url('admin/Ques/del'); ?>", {question_id: qid}, function(res, textStatus, xhr) {
                if (res.code == 0) {
                    layer.msg(res.msg, function () {
                    });
                } else {
                    layer.alert(res.msg, function () {
                        location.reload();
                    })
                }
			});
		});
	}
</script>
</body>
